import http from "@/utils/request";
// 获取验证码
export let getCaptcha = () => http.get("/users/getCaptcha?v=next");

// 校验验证码
export let verifyCaptcha = (captcha) =>
  http.get("/users/verifyCaptcha", {
    params: {
      captcha,
    },
  });

// 常规登录
export let loginApi = (username, password) =>
  http.post("/users/login", {
    username,
    password,
  });

// 请求微信二维码地址
export let getqrCodeApi = (sid) =>
  http.get("/users/getQrcode", {
    params: {
      sid,
    },
  });

// 微信登录
export let wechatLoginApi = (wechatCode) =>
  http.get("/users/wechatLogin", {
    params: {
      wechatCode,
    },
  });

//获取手机验证码
export let getMessage = (phoneNumber) =>
  http.post("	/sms/send", {
    phoneNumber,
  });

// 手机验证码登录
export let getMessageLogin = (code) =>
  http.post("/users/login?type=sms", {
    code,
  });
